package com.stox.ui.javafx.charting.application;

import java.util.Locale;

import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import com.stox.dto.intf.Application;
import com.stox.ui.javafx.charting.view.ChartingViewDisplayHelper;
import com.stox.ui.javafx.core.view.View;

@Component
@Lazy(false)
public class ChartingApplication implements Application {
	
	@Autowired
	private MessageSource messageSource;
	
	@Autowired
	private ChartingViewDisplayHelper chartingViewDisplayHelper;
	
	@Override
	public String getName() {
		return messageSource.getMessage("Chart", null, Locale.getDefault());
	}

	@Override
	public String getDescription() {
		return messageSource.getMessage("text.charting.application.description", null, Locale.getDefault());
	}

	@Override
	public String getApplicationClassName() {
		return this.getClass().getCanonicalName();
	}

	@Override
	public String getIconPath() {
		return null;
	}

	@Override
	public String[] getTags() {
		return null;
	}

	@Override
	public void launch(ApplicationContext applicationContext) {
		View view = new View();
		view.setPrefHeight(300);
		view.setPrefWidth(400);
		view.setLayoutX(500);
		view.setLayoutY(500);
		TabPane tabPane = new TabPane();
		Tab tab = new Tab("asdf");
		tabPane.getTabs().add(tab);
		view.getContentPane().getChildren().add(tabPane);
		view.open();
	}
	
}
